<template>
    <el-dialog
        class="ba-operate-dialog"
        :close-on-click-modal="false"
        v-model="baTable.table.extend!.showStatusLogDialog"
        @close="baTable.toggleForm"
        width="50%"
    >
        <template #header>
            <div class="title" v-drag="['.ba-operate-dialog', '.el-dialog__header']" v-zoom="'.ba-operate-dialog'">
                {{ $t('shop.order.order.orderStatusLog') }}
            </div>
        </template>
        <el-scrollbar v-loading="baTable.form.loading" class="ba-table-form-scrollbar">
            <div
                class="ba-operate-form"
                :class="'ba-' + baTable.form.operate + '-form'"
                :style="config.layout.shrink ? '' : 'width: calc(100% - ' + baTable.form.labelWidth! / 2 + 'px)'"
            >
                <el-form
                    v-if="!baTable.form.loading"
                    ref="formRef"
                    @submit.prevent=""
                    :model="baTable.form.items"
                    :label-position="config.layout.shrink ? 'top' : 'right'"
                    :label-width="baTable.form.labelWidth + 'px'"
                >
                    <el-timeline style="padding: 10px">
                        <el-timeline-item
                            v-for="(item, index) in baTable.table.extend!.orderStatusLog"
                            :key="index"
                            :timestamp="item.create_time"
                            :color="item.color"
                            placement="top"
                        >
                            <el-card>{{ item.msg }}</el-card>
                        </el-timeline-item>
                    </el-timeline>
                </el-form>
            </div>
        </el-scrollbar>
    </el-dialog>
</template>

<script setup lang="ts">
import { inject } from 'vue'
import baTableClass from '/@/utils/baTable'
import { useConfig } from '/@/stores/config'
const config = useConfig()

const baTable = inject('baTable') as baTableClass
</script>

<style scoped lang="scss"></style>
